﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AsmShaderConverter.HlslShader.Sampler
{
    internal enum SamplerType
    {
        Sampler2D,
        SamplerCube
    }
    internal class HlslSampler
    {
        public int Register { get; set; }

        public SamplerType Sampler { get; set; }

        public string ExportName { get; set; }

        public HlslSampler(AsmShader.ExportRegisterNames exportRegister)
        {
            this.Register = Convert.ToInt32(exportRegister.registerName.Replace("s", ""));
            switch (exportRegister.typeName)
            {
                case "sampler2D":
                    this.Sampler = SamplerType.Sampler2D; break;
                case "samplerCUBE":
                    this.Sampler = SamplerType.SamplerCube; break;
                default:
                    throw new Exception("unknown samper: " + exportRegister.typeName);
            }
            this.ExportName = exportRegister.ExportName;

        }

    }
}
